CREATE EXTERNAL TABLE `jms_ods`.`yl_tmsnew_tms_shipment_stop_hf`(
    `id` bigint COMMENT '经停点编码'
    , `shipment_id` bigint COMMENT '任务ID'
    , `shipment_no` string COMMENT '任务编号'
    , `sort_num` bigint COMMENT '顺序编号'
    , `network_id` bigint COMMENT '经停网点ID'
    , `network_code` string COMMENT '经停网点编号'
    , `network_name` string COMMENT '经停网点名称'
    , `roadsection_id` bigint COMMENT '路段编号'
    , `planned_arrival_day` string COMMENT '计划到达日期'
    , `planned_arrival_hour` string COMMENT '计划到达时间'
    , `planned_arrival_time` timestamp COMMENT '计划到达日期+时间'
    , `actual_arrival_time` timestamp COMMENT '实际到达时间'
    , `planned_departure_day` string COMMENT '计划离开日期'
    , `planned_departure_hour` string COMMENT '计划离开时间'
    , `planned_departure_time` timestamp COMMENT '计划离开日期+时间'
    , `actual_departure_time` timestamp COMMENT '实际离开时间'
    , `stop_time` bigint COMMENT '经停时长'
    , `usetime` bigint COMMENT '运输耗时(MIN)'
    , `mileage` double COMMENT '规划里程(KM)'
    , `speed` double COMMENT '时速(KM/H)'
    , `batch_time` string COMMENT '批次时间'
    , `handling_type` string COMMENT '装卸类型'
    , `load_start_time` timestamp COMMENT '开始装货'
    , `load_end_time` timestamp COMMENT '装货完成'
    , `unload_start_time` timestamp COMMENT '开始卸货'
    , `unload_end_time` timestamp COMMENT '卸货完成'
    , `app_arrival_time` timestamp COMMENT 'APP到达时间'
    , `app_departure_time` timestamp COMMENT 'APP离开时间'
    , `gps_arrival_time` timestamp COMMENT 'GPS到达时间'
    , `gps_departure_time` timestamp COMMENT 'GPS离开时间'
    , `lock_time` timestamp COMMENT '锁车时间'
    , `unlock_time` timestamp COMMENT '解锁时间'
    , `weight_arrival_time` timestamp COMMENT '过磅进站时间'
    , `weight_departure_time` timestamp COMMENT '过磅出站时间'
    , `arrival_gross_weight` double COMMENT '到达毛重'
    , `arrival_tare_weight` double COMMENT '到达皮重'
    , `arrival_net_weight` double COMMENT '到达净重'
    , `departure_gross_weight` double COMMENT '离开毛重'
    , `departure_tare_weight` double COMMENT '离开皮重'
    , `departure_net_weight` double COMMENT '离开净重'
    , `estimate_arrival_time` timestamp COMMENT '预计到达时间=上一站实际发车时间+本站运输耗时(MIN)'
    , `plan_driving_time` bigint COMMENT '规定行驶时间'
    , `actual_driving_time` bigint COMMENT '实际行驶时间'
    , `actual_arrival_time_source` string COMMENT '实际进站时间来源'
    , `actual_departure_time_source` string COMMENT '实际出站时间来源'
    , `estimate_batch_time` timestamp COMMENT '应赶批次'
    , `actual_batch_time` timestamp COMMENT '实赶批次时间'
    , `create_by` bigint COMMENT '创建人ID'
    , `create_by_name` string COMMENT '创建人姓名'
    , `create_time` timestamp COMMENT '创建时间'
    , `update_by` bigint COMMENT '更新人ID'
    , `update_by_name` string COMMENT '更新人姓名'
    , `update_time` timestamp COMMENT '更新时间'
    , `simple_name` string COMMENT '网点简称'
    , `latest_arrival_time` timestamp COMMENT '最晚到车日期+时间'
    , `latest_arrival_hour` string COMMENT '最晚到车时间'
    , `latest_arrival_day` string COMMENT '最晚到车日期'
    , `gps_depart_mileage` double COMMENT 'GPS发车里程'
    , `gps_arrival_mileage` double COMMENT 'GPS到车里程'
    , `is_send` tinyint COMMENT '是否发送gps发车预警消息')
COMMENT '运单经停点'
PARTITIONED BY (`dt` string COMMENT '更新/创建日期 (yyyy-MM-dd)')
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1'
)
STORED AS
  INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
  OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION '/dw/hive/jms_ods.db/external/yl_tmsnew_tms_shipment_stop_hf';